home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / answers / linux-faq / part4 < prev    next >
Encoding:
Text File  |  1993-06-11  |  54.9 KB  |  1,485 lines

  1. Newsgroups: comp.os.linux,comp.os.linux.announce,comp.answers,news.answers
  2. Path: senator-bedfellow.mit.edu!enterpoop.mit.edu!spool.mu.edu!uwm.edu!cs.utexas.edu!math.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!agate!doc.ic.ac.uk!warwick!uknet!mcsun!julienas!geocub!labri.greco-prog.fr!corsini
  3. From: corsini@labri.greco-prog.fr
  4. Subject: Linux Frequently Asked Questions 4/6 [monthly posted]
  5. Message-ID: <PART4_739718152@geocub.greco-prog.fr>
  6. Followup-To: poster
  7. Summary: Linux, a small and free unix-like for 386-AT computers.
  8. Sender: corsini@greco-prog.fr (Marc-Michel CORSINI)
  9. Reply-To: linux@numero6.greco-prog.fr
  10. Organization: Greco Prog. CNRS & LaBRI, Bordeaux France
  11. References: <PART3_739718152@geocub.greco-prog.fr>
  12. Date: Thu, 10 Jun 1993 13:16:49 GMT
  13. Approved: news-answers-request@MIT.Edu
  14. Expires: Sat, 24 Jul 1993 13:15:52 GMT
  15. Lines: 1467
  16. Xref: senator-bedfellow.mit.edu comp.os.linux:45695 comp.os.linux.announce:773 comp.answers:944 news.answers:9275
  17.  
  18. Archive-name: linux-faq/part4
  19.  
  20. Last-Modified: 93/06/11
  21. Version: 1.19
  22.  
  23. *********************************************************
  24. *                            *
  25. *   Answers to Frequently asked questions about Linux   *
  26. *                            *
  27. *********************************************************
  28.  
  29. This post contains Part 4 of the Linux FAQ (6 parts).
  30. It must be read *after* the 3 first parts. 
  31.  
  32. ===================================8<====>8============================
  33. CONTENTS (of this part)
  34.  
  35.     VIII.     FEATURES             (part4)
  36.     IX.     GCC MISC INFORMATION        (part4)
  37.     X.    SCSI SPECIAL            (part4)
  38.  
  39. ===================================8<====>8============================
  40.  
  41.  
  42. VIII. FEATURES 
  43. ==============
  44.  
  45. VIII.01)  I've read that linux has virtual consoles, what must I do to
  46. get them?
  47.  
  48. ANSWER: Yes there are, you can access them with the left <alt>-key
  49. together with <Fn>-key. With the Linux Images distribution, 4 consoles
  50. are available, getty runs on them.  
  51. Notice that they are NOT accessible when running X (contrary to some
  52. commercial unices).
  53.  
  54. VIII.02)  When Linux boots, I get the following message "8 virtual
  55. consoles"; how can I acess to the 5-8 vc's ?
  56.  
  57. ANSWER: If you want the getty to run on the 5-8, you should add the
  58. corresponding entries in /etc/inittab. You can also just run sh on
  59. them by using the doshell soft.
  60. And then in either case, the ALT-F[5-8] will access the corresponding
  61. vc.  
  62.  
  63. VIII.03)  What kind of shell is /bin/sh ?
  64.  
  65. ANSWER: It's the Bourne Again Shell, bash-1.12.3 and 
  66. compilation was straightforward, just "make" 
  67. that's all or nearly. 
  68. BTW There does exist different shells for Linux, these are:
  69. bash, rc, zsh, tcsh and pdksh (a korn shell).
  70.  
  71.  
  72. VIII.04)  Does there exist a man page for **** ?
  73.  
  74. ANSWER: Download man.tar.Z from your favorite linux ftp site, there is
  75. most of the fileutils man page -- either **** or g****, example there
  76. is nothing on ld, but there is for gld :) --, check the whatis
  77. database provided. The files in the cat1 dir are pre-formatted man
  78. pages that the man program can use. Quite recently the man pages for
  79. section 2 have been written (thanks Drew) and can be found, at least
  80. at tsx-11 in /pub/linux/docs/man/man2.tar.Z 
  81.  
  82. Also manpages are in the SLS on the b? disks.
  83.  
  84. BTW there is nroff and groff for Linux. Cawf 2.0 works just
  85. fine for simple man pages, and a partial ms support too. 
  86.  
  87.  
  88. Moreover Michael Johnson is the coordinator for man pages under Linux,
  89. he is looking for volunteers, so contact the DOC Channel.
  90.  
  91. VIII.05)  Is there a simple man package (groff is too big):
  92.  
  93. ANSWER: "Cawf -man" also "fm -m" (Al Clark) tsx-11 in
  94.      /pub/linux/binaries/usr.bin/fm.tar.Z 
  95.  
  96.  
  97. VIII.06)  What are the editors available in linux?
  98.  
  99. ANSWER: Right now there are uemacs-3.11, elvis-1.4 (1.5). 
  100. Gnu Emacs is there, read the section devoted to it in the 5th part of
  101. this FAQ. Also the port of mg (micro gnu) has been done and can be
  102. found at least at athos.rutgers.edu (128.6.4.4) 
  103. in pub/linux, mg is the binary and mg.tar.Z is the sources file. You
  104. can also find a PD ed, and elvis has an ex mode. Also available is
  105. Lucid Emacs (available on sunsite.unc.edu in
  106. pub/Linux/apps/editors/lemacs), including binary and info and lisp
  107. trees (it takes about 18MB of disk space). Finnally there are
  108. joe, vile-3.11, elle (Elle Looks Like Emacs), Xedit and aXe.
  109.  
  110. VIII.07)  Does there exist a printer package for Linux?
  111.  
  112. ANSWER: (R. Miller) Yes.  The "plp" package is currently available
  113. under the directory [/pub/linux]/BETA/plp on tsx-11 and its mirrors.
  114. You may also print things manually like so:  cat filename > /dev/lp1 
  115. (Note that though "/dev/lp0" exists, most people find that their
  116. printer is on /dev/lp1.  Use whatever the kernel says that it detects
  117. in the boot-up messages.) 
  118.  
  119. VIII.08)  Are uucp, mail, and/or USENET news available for Linux?
  120.  
  121. ANSWER:    Yes !!!  Read the section UUCP/NEWS/MAIL for LINUX in this
  122. FAQ. Moreover if you are interested in the last uucp features, join
  123. the UUCP channel (see  part1 of this FAQ for more details about the
  124. multi channels list). 
  125.  
  126. VIII.09)  How do I make swapping work?
  127.  
  128. ANSWER: Quite simply, you need the swapon and the mkswap binaries.
  129. Then you can choose between a swap partition or a swap file.
  130. The mkswap is used to write the "swap signature", whilst the swapon
  131. binary is to activate the swapping. 
  132.  
  133. First of all you need a partition :), I assume it's the second of your
  134. first disk namely /dev/hda2, and it's 10MB big
  135. A) swap partition:
  136. you have to indicate it's a swap area, this is done via mkswap
  137. (instead of mkfs) which needs the name of the partition and the size
  138. in blocks (a block is 1Ko big); the optional -c flag is for bad block
  139. checking. So for our example you should perform:
  140. mkswap [-c] /dev/hda2 10000
  141. Then you need to indicate that you want linux to use the swap area,
  142. this is done via swapon. In general it is set in the /etc/rc file,
  143. just put the following entry:
  144. /bin/swapon /dev/hda2
  145. It can also be achieved via the /etc/fstab file
  146. B) swap file:
  147. The process is quite close; you need a partition, and a swap file.
  148. Assume that I prefer a swap area of 4MB (I want to keep some place in
  149. /dev/hda2). I need first to "dd" the file.
  150. dd if=/dev/hda2 of=/swap_file bs=1024 count=4096
  151. bs stands for block size, and count is the number of blocks
  152. then I have to put the "swap signature" on that file:
  153. mkswap /swap_file 4096
  154. At this point, you should 'sync', just to be sure the signature is
  155. effective. And finally add an entry in the rc file:
  156. /bin/swapon /swap_file
  157.  
  158.  
  159. VIII.10)  When I boot I get one of the following messages:
  160. "Unable to find swap signature" or "Bad swap-space bitmap"
  161.  
  162. ANSWER: You probably forgot to make your swap-device, use the mkswap
  163. command. 
  164.  
  165.  
  166. VIII.11)  How do I know if it is swapping?
  167.  
  168. ANSWER: You will notice it :)) First of all, Linux tells you at boot
  169. time, "Adding swap: XXX pages of swap space", and if you start running
  170. out of memory, you will notice that the disk will work overtime, and
  171. things slow down. Generally a 2Meg RAM will make the system swap
  172. constantly while running gcc, 4 Meg will swap occasionnaly when
  173. optimizing big files (and having other things active, such as make).
  174. Also, the command 'free' (from the ps package) reports total enabled
  175. swap space and current swap use.
  176.  
  177.  
  178. VIII.12)  How is it possible to remove a swap file?
  179.  
  180. ANSWER: Simply perform a rm on that file, and remove the swapon of
  181. your /etc/rc file.
  182.  
  183.  
  184. VIII.13)  How is it possible to remove a swap device?
  185.  
  186. ANSWER: mkfs the device, and remove the swapon of your /etc/rc file.
  187.  
  188. VIII.14)  How much swap space do I need ?
  189.  
  190. ANSWER: Linux does not perform real swapping, it's rather paging (see
  191. below for a more complete explanation). The swap area is *added* to
  192. the memory and can be viewed as virtual memory, so choose the size you
  193. need, example:
  194.  
  195.         8MB RAM + 6MB swap => 14MB virtual memory
  196.  
  197. VIII.15)  Could someone explain the swap process on Linux?, is it
  198. swapping or paging ?
  199.  
  200. ANSWER: (Linus) Linux uses swap as /additional/ memory, one page of
  201. the swap-space is used for the good-page bitmap and the swapspace
  202. signature. 
  203. In fact Linux does only paging, no swaping in the meaning "write out
  204. one whole process to disk".
  205. The reason it's called swapping is that Linux used paging for memory
  206. management on a low level since the very beginning, but didn't page to
  207. disk at all until 0.12. 
  208.  
  209. VIII.16)  Is demand paging different from paging and How ?
  210.  
  211. ANSWER: (Linus) Demand-paging is really "demand loading of
  212. executables" and is totally independent of the page-swapping
  213. algorithms, although they have similarities. When Linux strts up a
  214. process, no actual code space is loaded: I let the page exceptions
  215. load in the executable as needed. Thus Linux demand-loads the code and
  216. initialized data it needs.
  217. Demand-loading has very good points: (a) it simplifies the exec system
  218. call; (b) it means page sharing between that have excuted the same
  219. file is easy to implement; (c) it cuts down on the amount of memory
  220. required. When Linux runs out of real memory, it starts to lock for
  221. pages it can swap out, but if it notices that the page is clean, it
  222. just forgets about it, and demand-loads it when it's needed again.
  223. Thta means that swap-file isn't needed as much, especially when
  224. running big binaries such as gcc, where the code-pages can be
  225. demand-loaded as you wish.
  226.  
  227. Point (c) means that even without any swap space, you can usually run
  228. slightly larger programs that your memory setup would actually permit.
  229. I've noticed this while running X and doing a kernel compilation +
  230. something else wshen I've forgotten to turn on swapping: free reports
  231. 0 page available but things still work, although performance is
  232. slightly down... 
  233.  
  234. VIII.17)  Is there any way to tell how much swap space you are using
  235. or have left? 
  236.  
  237. ANSWER: The free program provided with the ps package handles this.
  238.  
  239.  
  240. VIII.18)  I have a 2Megs box, but "free" reports only 1Meg why?
  241.  
  242. ANSWER: (Linus:) "free" doesn't concern with the memory the kernel has
  243. allocated for itself. In other words what you see is the *user* memory
  244. available. The kernel has taken the low 1Meg for it's use (~250Ko for
  245. it and the rest for buffer cache and kernel data structures); for big
  246. memory machine it could be even 2Megs.
  247.  
  248. VIII.19)  What tape drives work with Linux ?
  249.  
  250. ANSWER: (24 sept. P. Riipinen)
  251. - There is a working QIC-02 device driver for Linux, supporting (at
  252.   least) Everex/Wangtek cards.
  253. - There are additional patches for the QIC-02 to support Archive
  254.   SC402/499R. You can find them in /pub/linux/alpha/qic-02 at tsx-11
  255.   There are some bugs in the driver but you can backup.
  256. - Newer drivers are all SCSI, so check the SCSI section in this FAQ.
  257.  
  258.  
  259. VIII.20)  Is there a driver for my Colorado Jumbo tape drive ?
  260.  
  261. ANSWER: (Charlie Brady 93/06)
  262. Not at this stage, although some are trying. The Colorado Memory
  263. Systems tape drive connects to the standard floppy disk controller as
  264. a third device on the cable. Similar drives are sold by Irwin,
  265. Mountain, Wangtek and others and they are collectively known as QIC-40
  266. and QIC-80 drives. The medium is a DC-2000 or DC-2120 minicartridge.
  267. There is a pre-pre-alpha version of a driver, and appropriately
  268. skilled volunteers are encouraged to try to finish it.  Be warned, the
  269. timing constraints of the interface may be a significant problem.
  270.  
  271.  
  272.  
  273. VIII.21)  Is there only the %$#@ keyboard ?
  274.  
  275. ANSWER: There are Dannish, Finnish, French, German, Uk, US and DVORAK 
  276. keyboards. Set it in the main Makefile of the kernel sources, then  
  277. (re)compile the kernel again. Make sure the files in kernel/chr_drv
  278. directory are recompiled.   
  279.  
  280.  
  281. VIII.22)  (special FINNISH/US) I booteed up with the new image and
  282. everything work except that some keyboard keys produce wrong
  283. characters. Does anyone know what is happening?
  284.  
  285. ANSWER: Since 0.95a images are US product (and so are US-keyboard
  286. oriented), BUT linux sources are FINNISH product, and so the default
  287. keyboard is set to be FINNISH. The solution is in the previous Q/A.
  288.  
  289.  
  290. VIII.23)  Does there exist shared libs ?
  291.  
  292. ANSWER: (H.J. Lu, hlu@eecs.wsu.edu, 09/01/92)
  293.  
  294. The shared library under Linux started at 0.12. Peter MacDonald
  295. collaborating with Linus made the first generation of shared library,
  296. which is the base of the classic shared library which is no longer widely
  297. used.
  298.  
  299. The kernel support of shared library under Linux is system call
  300.  
  301. extern int uselib (const char *__filename);
  302.  
  303. which loads an executable image with fixed entry point into memory,
  304. just like the ordinary executables.
  305.  
  306. In crt0.s, a function which can find out if and which shared images
  307. are needed and loads them is invoked before `main ()' is called if
  308. necessary. David Engel and I developed a way to tell the loader which
  309. shared images have to be loaded, utilizing the similar technique used
  310. in global constructor in g++ 2.x with the help from GNU binary
  311. utilities.
  312.  
  313. In the classic Linux shared library, we build a big executable image 
  314. for several libraries and make sure no external variables outside of
  315. the participating libraries are referenced. Then we can get the
  316. absolute addresses of all the global variables defined in the
  317. libraries used to build that executable image. After that, we make a
  318. stub library for each participating library which just has the
  319. absolute addresses of all the global variable in it.
  320.  
  321. For each shared image, there must be one and only one .o file, which
  322. defines a global variable containing version, name and entry point of
  323. the shared image, and a dummy global data. Among those libraries used
  324. to build the shared image, there must be one library which will always
  325. be referenced whenever any other library is referenced. We put this .o
  326. file into the stub library for that library and add a special symbol
  327. to each of the components of the stub library in order to make sure
  328. that this .o file is always linked in if any of the participating
  329. libraries are linked.
  330.  
  331. In gcc 2.2.2d, jump table, developed by David Engel, was introduced in 
  332. the shared library. At the beginning of each shared image, there is
  333. a table in which every library function has a fixed entry address and
  334. the instruction at that address is a jump which will lead to the
  335. real library function. So we can change the library function without
  336. changing the corresponding entry address of the jump table. For the
  337. global data we put them at the beginning of data section of the shared
  338. image. We have to separate them from text code and link them in fixed
  339. order. It is very hard to maintain the same addresses for the global
  340. data when library is changed. After the global data are set up properly
  341. and some spaces are left for possible future changes (that is a very
  342. tough procedure.), it isn't too difficult to maintain.
  343.  
  344. Starting with libc.4.3, a form of dynamic linking developed by Eric
  345. Youngdale was introduced into the shared libraries.  As part of this,
  346. the tools that were used to generate the sharable libraries were
  347. completely redone which made the job of building the libraries much
  348. easier, and thus the libX*.so.3.0 libraries were made as DLL jumptable
  349. libraries.
  350.  
  351. VIII.24)  Why do I need dynamic linking.
  352.  
  353. ANSWER: The best way to illustrate this is with a simple example of
  354. what happens without dynamic linking.
  355.  
  356.     #include <stdio.h>
  357.  
  358.     int errno;
  359.     FILE * foo;
  360.  
  361.     main(){
  362.         foo = fopen("/usr/bin/foo","w");
  363.         printf("foo: %x errno: %d\\n",foo, errno);
  364.     }
  365.  
  366. Assume this program is run by a non-root user. Normally you would
  367. expect that the open will fail because the user does not have
  368. permission to write to /usr/bin - this means that fopen() would return
  369. NULL, and errno would contain 13, which means EACCES - Permission
  370. denied. If you link this to a normal jump table library, it prints
  371.  
  372.     foo: 0  errno: 0
  373.  
  374. Now consider the following nearly identical program:
  375.  
  376.     #include <stdio.h>
  377.  
  378.     extern int errno;
  379.     FILE * foo;
  380.  
  381.     main(){
  382.         foo = fopen("/usr/bin/foo","w");
  383.         printf("foo: %x errno: %d\\n",foo, errno);
  384.     }
  385.  
  386. The results for this program are:
  387.  
  388.     foo: 0  errno: 13
  389.  
  390. Why does this happen???. First of all you must realize that in the
  391. first program errno is not declared external, and thus storage will be
  392. allocated in the data segment for the variable. Unfortunately there
  393. is no way to tell libc this, and libc has it's own storage for errno.
  394. Thus libc writes the result in one location and you are looking in the
  395. other. In the second program errno is declared extern, and thus no
  396. storage will be allocated. The linker will see the need for a
  397. definition of errno, and it will find one in libc. Thus in the second
  398. example the user program is reading the same memory location that the
  399. library stored the answer in.
  400.  
  401. This is of course a simple example. There are more complicated
  402. examples involving programs that want to redefine a library function
  403. and these can lead to quite bizarre behavior which is difficult to debug.
  404.  
  405. With dynamic linking, both of the above programs yield the same
  406. (correct) result.
  407.  
  408. VIII.25)  How does dynamic linking work under linux?
  409.  
  410. ANSWER:  Basically, to implement dynamic linking we need to route all
  411. function calls to global functions through the jump table. We also
  412. need to make sure that all global data is accessed indirectly through
  413. a pointer. The actual libraries do not really look very much
  414. different from the actual jump table libraries that we are currently
  415. using, but there are additional pointers to the global data in the
  416. sharable image that are used internally by the library to access all
  417. global data. There are also additional symbols in the stub library
  418. that are defined as the address of the various pointers, and are used
  419. by the linker to help determine whether there is a pointer or a jmp
  420. instruction that needs to be fixed up.
  421.  
  422.     The linker has one new important task with dynamic linking.
  423. It watches for duplicate definitions of symbols, and if the
  424. second definition is in a sharable library, it makes a note of it as a
  425. conflict that needs to be resolved at run time. The linker puts a list
  426. of all of these conflicts into a table and makes it available to crt0
  427. through the variable __SHARABLE_CONFLICTS_.
  428.  
  429.     At run time, crt0 (through the function __dynamic_resolve)
  430. will go through and fix up all of the pointers that need to be fixed.
  431. Let us say for example that you define your own malloc function in a
  432. program - in this case at run time the startup code will actually
  433. modify the jmp instruction in the jump table so that it points to the
  434. malloc function in your program, not the one in the library.  The
  435. library will never refer to the malloc function directly, but it will
  436. always be referenced through the jump table - in this way we ensure
  437. that there will only be one function named malloc that is used by a
  438. given program.
  439.  
  440.     If you were to run the first example program in the "Why do I
  441. need dynamic linking" answer, then the pointer in the library that
  442. corresponds to the variable errno will be modified so that it points
  443. to the errno variable that is in your program.  The library itself
  444. will never use errno directly - it will always use it via the special
  445. pointer variable.  In this way we ensure that all references to the
  446. variable errno both in your program and in the sharable library will
  447. reference the same memory address.
  448.  
  449. VIII.26)  Does Linux work for SCSI drives?
  450.  
  451. ANSWER: Yes since v0.96. Read the section devoted to SCSI in this FAQ
  452. (check the TOC file to find the section).
  453.  
  454.  
  455. VIII.27)  Linux is supposed to work with ESDI drive. However I have
  456. trouble with my Magtron MT-4115E (Joincom controler), any clue?
  457.  
  458. ANSWER: (Linus) Some harddisk don't like linux (even though they
  459. should). Maybe not a bug but a deficiency.
  460. (Mika) I had to remove the printk "unexpected hd interrupt" statement
  461. in hd.c because I was getting so many of those messages. Be warned
  462. that if there is any read error the system just hangs, even the
  463. ctrl-alt-del won't work. You should be able to use your ESDI drives if
  464. you could live with those nuisances.
  465.  
  466. VIII.28)  How does one go about applying a patch to Linux ?
  467.  
  468. ANSWER: (Drew Eckhardt) In the unix world most of distribution are in
  469. source form. This includes the operating system. To apply a patch, you
  470. apply it with the 'patch' program to the affected sources. The patch
  471. program takes as input the differences between the old and the new
  472. version. After patching you need to recompile the sources.
  473.  
  474. Assume I want to apply a patch enclosed in the file XXX. First of all
  475. I will look at the top of XXX, where the file affected is identified.
  476. This may have aleading path attached to it. Either cd out to the
  477. "root" of the patch, ie if I see
  478. linux/kernel/blk_drv/blk.h
  479.  
  480. I would cd into /usr/src 
  481. (assuming it's the place where I can find linux/kernel...) 
  482. and then patch as follows
  483. patch -p0 < whatever_place/XXX
  484.  
  485. or, you can specify a number of path components to strip from the
  486. path. If I am in the blk_drv directory patching would be
  487. patch -p3 < whatever_place/XXX
  488.  
  489.  
  490. VIII.29)  There are a lot of patches available (ps patch, NFS patches,
  491. CD-ROM patches ...) can I be fairly confident the subsequent patches will
  492. work?
  493.  
  494. ANSWER: This is not true yet for the current version; but it will be
  495. so I kept it :) 
  496. No you can't, patching is a real beta tester art :)).  People are not
  497. working on the same patched release, so you have to check if the
  498. patches you already applied works on the same kernel part, if not,
  499. /great/, just apply them. If yes, check if there is an order, patch
  500. creator knows that, and (should) try to warn patch user (in other
  501. words: beta tester) otherwise you should edit the patch files (and
  502. possibly make a brief note to others on this list/newsgroup or even a
  503. cdiff) before applying them, another solution is to keep cool and wait
  504. for the next version of Linux where, in general, the modifications
  505. have been done but this behavior is /not/ Linux helpful.
  506.  
  507.  
  508. VIII.30)  I got the patches on some ftp sites, and applied them to the
  509. kernel and tried to compile. It didn't !!. Are the patches buggy?
  510.  
  511. ANSWER: Before remake, just do a make clean in the directories
  512. involved by the patches. This will force a rebuild of the .o and .a
  513. files. 
  514. If you have a RCS running on your source tree, did you checked a
  515. patched version of the files changed before /any/ CO either by you or
  516. make
  517.  
  518. Finally, make sure the patches succeded. Normally, failed patches on a
  519. file FILE will leave a FILE# file. Moreover you will get a "chunk
  520. failed" message. It is possible to capture the output while patching,
  521. with the following:
  522.  
  523.     patch -p0 < patchfile | 2>&1 patch.result | more
  524.  
  525.  
  526. VIII.31)  What is VFS?
  527.  
  528. ANSWER: (Ted) Linux 0.96 already has Virtual FileSystem, which means
  529. that it acts as a filesystem switch. It makes it easy for someone to
  530. design another filesystem format and include it in the Linux kernel
  531. along with the standard minix filesystem format. So it /enables/
  532. someone to design a robust filesystem which would have some nice
  533. properties (no 14 chars file name limitation, nor 64Meg limit), and
  534. could be included in the kernel in such a way that both the Minix and
  535. the new one could be mounted at the same time. This solves the
  536. uncompability problem; since the root disk could still use the Minix
  537. filesystem, while the hardisk could be using the new one.
  538.  
  539.  
  540.  
  541. VIII.32)  What's about Bus Mice ?
  542.  
  543. ANSWER: (Nathan I. Laredo) Since the Linux v0.96c-pl2 the kernel does
  544. support LOGITECH and BUS MICE 
  545. If you are unsure that you have a bus mouse or not, check to see if
  546. your mouse card has a selection for a sample rate switchable between
  547. 30Hz and 60Hz (or possibly 25/50Hz), if it does not, then it is NOT a
  548. true  bus mouse (InPort mice for example will not work with this
  549. driver). 
  550. To create a bus mouse device:
  551. mknod /dev/mouse c 10 0
  552.  
  553.  
  554. VIII.33)  What's about TeX ?
  555.  
  556. ANSWER: The primary site for Linux TeX is 129.78.66.1, this is 
  557. P. Williams' site in Australia. The stuff at tsx-11 was posted by 
  558. T. Dunbar  who does support/maintain the dvilj stuff.
  559.  
  560.  
  561. VIII.34)  What's about LILO ?
  562.  
  563. ANSWER: (Werner Almesberger)
  564. LILO  -  Generic Boot Loader for Linux ("LInux LOader") 
  565.  
  566. This is an ALPHA test release of a new boot loader. Be sure to have
  567. some means to boot your system from a different media if you install
  568. LILO on your hard disk.
  569.  
  570. Features
  571. --------
  572.  
  573. - does not depend on the file system. (Tested with Minix, EXT FS and MS-DOS
  574.   FS.)
  575. - can be used to boot from floppies and from hard disks.
  576. - can replace the master boot record.
  577. - can boot non-Linux systems (MS-DOS, DR DOS, OS/2, ...) and unstripped
  578.   kernels.
  579. - supports up to 16 different boot images that can be selected at boot
  580.   time. Root and swap disk/partition can be set independently for each
  581.   image.
  582. - boot sector, file map and boot images can be all on different disks or
  583.   partitions.
  584.  
  585.  
  586. Restrictions and known problems
  587. -------------------------------
  588.  
  589. - SCSI disks are not fully supported yet. (Still waiting for some kernel
  590.   changes.) (Should work in current release - EY).
  591. - booting other operating systems doesn't seem to work everywhere. If
  592.   everything but booting a non-Linux OS from LILO works on your system,
  593.   you should boot LILO by BOOTACTV and select the alternate OS with the
  594.   latter as a temporary work-around.
  595. - booting non-Linux systems from the second hard disk ("D:") is not yet
  596.   supported.
  597.  
  598. Please send all bug reports to almesber@nessie.cs.id.ethz.ch
  599.  
  600.  
  601. VIII.35)  What's about MGR ?
  602.  
  603. ANSWER: (General Information grabbed from various sources)
  604. There is a MGR channel available , contact the request adress with
  605. help in the body: linux-activists-request@niksula.hut.fi 
  606. The stuff can be found at tsx-11 in pub/linux/packages/MGR
  607. In brief:
  608.  
  609. MGR provides:
  610.     - multiple overlapping windows
  611.     - multiple fonts
  612.     - text and graphics in each windows
  613.     - a simple popup menu package
  614.     - a client/server model 'a la' X
  615.     - independance from any peculiar networking technology
  616.  
  617. MGR consist of a server process and some clients. Each client has his
  618. own window, and can create subwindows. Clients communicate with the
  619. server via a bidirectionnal channel. A C library is provided.
  620.  
  621. When a new window starts, it is as a terminal emulator running the
  622. shell; for more information you can grab the mgr-man.out from
  623. bellcore.com 
  624.  
  625. The information hereafter appeared on the MGR channel on 19th Jan. 
  626. > From: u31b3hs@POOL.informatik.rwth-aachen.de
  627. > Subject: MGR 0.53
  628. >
  629. >
  630. > MGR, version 0.53 for Linux and SunOS (Coherent unfinished yet).
  631. >
  632. > Unpack the src* stuff under in /src/lbin/mgr and the usr* stuff in 
  633. > /usr/mgr.  I splitted things that way for making it easier to ftp
  634. > them and carry them home.  If you don't like these paths, then use
  635. > others, but remember to edit the Configfile after generating it. 
  636. > YOU NEED TO INSTALL ALL FILES FOR COMPILING.
  637. >
  638. > This is a beta release for programmers, there are no binaries.  It
  639. > makes my work available for people who either also work on MGR and
  640. > like to get new sources and for adventerous beta testers.  WARNING:
  641. > I assume using Linux 0.99.2 and GCC 2.3.3.
  642. >
  643. > There is some new m4 code to generate menus.  It is more powerful
  644. > than menu(1), but a little harder to use.
  645. >
  646. > MGR is currently being ported to Coherent 4.0, but this version
  647. > doesn't include everything yet.  There is already a beta version
  648. > running on Coherent, although not too stable yet.
  649. >
  650. > For questions, write to the mailing list, channel MGR.  Please be
  651. > sure to talk about the latest version of MGR plus having read the
  652. > README files in the directories containing the problem.
  653. >
  654. > You got this stuff from ftp.thp.uni-koeln.de:pub/linux/mgr or from 
  655. > tsx-11.mit.edu:~ftp/pub/linux/packages/MGR, which is a mirror of the
  656. > Cologne directory.
  657.  
  658. VIII.36)  I have successfully compiled MGR, but when I try to run the
  659. program I get "can't find mouse" or "already in use", any clue?
  660.  
  661. ANSWER: try the following "mgr -m /dev/ttys1" if the mouse is on
  662. the serial 1. Another possibility is to link /dev/mouse with
  663. /dev/ttys1 (assuming your mouse is on serial 1). Or if it's a bus
  664. mouse, "mknod /dev/mouse c 10 0" once.
  665.  
  666. VIII.37)  Any tips for MGR?
  667.  
  668. ANSWER: Well, I have tried it on my 386Sx Ega/Vga; the screen is Ok
  669. but the Logitech mouse I have is not well recognized.
  670.  
  671. BTW check the major/minor number for pty's; they should be character
  672. device with 4 as major and 128 and bigger as minor:
  673. ptyp0 c 4 128
  674. ptyp1 c 4 129
  675. ...
  676. ttyp0 c 4 192
  677. ttyp1 c 4 193
  678.  
  679. VIII.38)  What's about X11 ?
  680.  
  681. ANSWER: See the section XII. devoted to X11 in this FAQ.
  682.  
  683.  
  684.  
  685. IX. GCC MISC INFORMATION
  686. ========================
  687.  
  688. **** Last update 93/03/26
  689.  
  690.  
  691. IX.A. HLU Information
  692. IX.B. OTHERS
  693.  
  694.  
  695. IX.A. HLU Information
  696. ~~~~~~~~~~~~~~~~~~~~~
  697.  
  698. The official release of GCC for Linux is 2.3.3.
  699. This section includes:
  700.     README.gccdisk
  701.     FAQ of gcc written by HLU
  702.  
  703.  
  704.  
  705.   IX.01)  I don't know how to install gcc stuff, is there special
  706. places?
  707.  
  708. ANSWER: This is the README.gccdisk
  709.  
  710.                     Linux GNU C/C++ [HJ release]
  711.  
  712. Introduction
  713. ------------
  714.   This is GNU C/C++ 2.3.3. It is linked with jump table 4.2. You should use
  715.   it with the Linux C library disks since the C/C++ compiler has no shared
  716.   images, which are required by all the binaries in it.  It consists of
  717.   2 minix disks, which will fit on either 5.25" or 3.5" floppies.
  718.  
  719.   It is on tsx-11.mit.edu under pub/linux/GCC/gccdisk
  720.  
  721.  
  722. Distribution File Format
  723. ------------------------
  724. There are two files, each of which goes on one disk
  725.  
  726.   A. Disk 1 (gcc233a.Z)
  727.  
  728.   This contains gcc, cpp, cc1 and crt0.o/gcrt0.o.  There are also some header
  729.   files in /usr/lib/gcc-lib/i386-linux/2.3.3/include.
  730.  
  731.   B. Disk 2 (gcc233b.Z)
  732.  
  733.   This disk contains cc1plus.
  734.  
  735.  
  736. Installing on the Hard Drive
  737. ----------------------------------------
  738.   1. uncompress base[1|2].Z.
  739.   2. rawrite or dd each file to a formatted floppy disk.
  740.  
  741.   Now you have made a copy of gcc 2.3.3 on two floppies.  To copy each
  742.   floppy to your hd, you should mount the floppy and copy its contents to
  743.   your hard drive.  You can do this by:
  744.  
  745.     mount /dev/fd[0|1] /mnt
  746.     cd /mnt
  747.     for d in bin dev etc usr
  748.     do
  749.       if [ -d $d ]; then
  750.         cp -av $d /
  751.       fi
  752.     done
  753.  
  754.   Note: This may overwrite some files on your hard disk.
  755.  
  756. Thanks.
  757.  
  758. H.J.
  759. hlu@eecs.wsu.edu
  760. 12/31/92
  761.  
  762.  
  763.   IX.02)  What compiler should I use for Linux?
  764.  
  765. ANSWER: You should only use the same version on tsx-11.mit.edu under
  766. /pub/linux/GCC. If you want to use the testing release, first join
  767. the GCC channel on the Linux mailing list, and then send a note to
  768. hlu@eecs.wsu.edu. Don't use gcc older than the one on tsx-11.mit.edu.
  769.  
  770.   IX.03)  Where is the latest official gcc 2.xx for Linux?
  771.  
  772. ANSWER: It's on tsx-11.mit.edu under /pub/Linux/GCC and under
  773. pub/linux/GCC. You may find it on the other sites. Since gcc 2.3.3,
  774. you can compile it yourself out of box from any gnu ftp sites. Just
  775. unpack the source code and do
  776.  
  777.     configure [i386-linux|i486-linux]
  778.  
  779. You should follow the instructions in INSTALL.
  780.  
  781.   IX.04)  Where is the latest official Linux C library?
  782.  
  783. ANSWER: It's on tsx-11.mit.edu under /pub/Linux/GCC and under
  784. pub/linux/GCC. You may find it on the other sites.
  785.  
  786.   IX.05)  What are the contents of them?
  787.  
  788. ANSWER: Please read the current release note and ChangeLog for
  789. details.
  790.  
  791.   IX.06)  How do I install them?
  792.  
  793. ANSWER: Read README and release notes.
  794.  
  795.   IX.07)  What are the main differences with the old release?
  796.  
  797. ANSWER: Read README and release notes.
  798.  
  799.   IX.08)  Can I use the old version of gcc?
  800.  
  801. ANSWER: Please get rid of gcc older than gcc 2.2.2. Starting from
  802. gcc 2.2.2, you can do
  803.  
  804.     gcc -V xxxx
  805.  
  806. where xxxx is the version number. Please read `release.xxxx' for
  807. detail. There is one catch in gcc 2.2.2d, setjmp/longjmp is changed,
  808. so the old header files is not compatible with gcc 2.2.2. Before you
  809. install gcc 2.2.2d, please do
  810.  
  811. cp /usr/include/setjmp.h /usr/lib/gcc-lib/i386-linux/2.2.2/include
  812.  
  813. where /usr/include/setjmp.h is come with gcc 2.2.2.
  814.  
  815.   IX.09)  Can I delete the old shared image in /lib?
  816.  
  817. ANSWER: Since the Linux C library version 4.3, we have introduced the
  818. dynamically linked library. There is no need to keep old shared images
  819. in /lib if none of your binaries are linked with the classic shared
  820. library which has been obsolete. You can just keep one version of
  821. the shared image in /lib which has the highest major and minor
  822. release numbers for each shared library. The name of the shared image
  823. is "xxxxxxxxxxxxxxx.so.major.minor".
  824.  
  825.   IX.10)  Is stdio ANSI compatible?
  826.  
  827. ANSWER: Yes, please test it.
  828.  
  829.   IX.11)  Is g++ in 2.xx?
  830.  
  831. ANSWER: Yes.
  832.  
  833.   IX.12)  Where can I get the gcc manual?
  834.  
  835. ANSWER: You can get man pages and manual come with the gcc source code
  836. on any gnu ftp sites. You should find gcc-man.tar.z on tsx-11 which
  837. has man pages for gcc.
  838.  
  839.   IX.13)  What options can I use for gcc?
  840.  
  841. ANSWER: Read the manual. There is one special flag for Linux, -static
  842. tells gcc to use the static libraries. The default is the jump table
  843. version of shared libraries.
  844.  
  845.   IX.14)  How can I debug the C code?
  846.  
  847. ANSWER: Read the gcc/gdb manuals. The simple way to do is
  848.  
  849.     gcc -g foo.c -o foo
  850.     gdb foo
  851.  
  852.   IX.15)  Where is the source code of the new libc.a?
  853.  
  854. ANSWER: The same place you find this file. It is called
  855. libc-xx.yy.tar.z.
  856.  
  857.   IX.16)  Why does g++ complain, even die?
  858.  
  859. ANSWER: You need "expr", which is in GNU shell utilities 1.6, echo (?)
  860. and sed.
  861.  
  862.   IX.17)  How do I generate code for 486?
  863.  
  864. ANSWER: Add -m486 to CFLAGS.
  865.  
  866.   IX.18)  I heard malloc (0) wouldn't work with Linux, what should I
  867. do?
  868.  
  869. ANSWER: It *does* work in a manner which POSIX allows; unfortunately,
  870. pre-POSIX code frequently assumes that malloc(0) will not return
  871. 0 -- the standard version of malloc under Linux *does* return 0.
  872. By including <stdlib.h>, you get a definition of malloc which behaves
  873. more traditionally.  If you define NO_FIX_MALLOC, then you will get
  874. the default (non-traditional) form.  If you are trying to develop POSIX
  875. compliant code under Linux, you should probably define NO_FIX_MALLOC to
  876. ensure that your code doesn't make assumptions about malloc() which
  877. will not work on other systems.  (Note: NO_FIX_MALLOC is specific to
  878. Linux.)
  879.  
  880. (Provided by Phil.Richards@prg.oxford.ac.uk. Thanks.)
  881.  
  882.   IX.19)  Why does gcc say "xxxxx..h not found"?
  883.  
  884. ANSWER: see QUESTION: What are the contents of them?
  885.  
  886.   IX.20)  I really followed every step in the documentation, but when
  887. I do "make", why does it say "don't how to make xxxxxx"?
  888.  
  889. ANSWER: The dependency in Makefile is dated, you need to make a new
  890. one. Please get some guide on make and read Makefile. For the kernel
  891. sources, please do
  892.  
  893. cd src/linux
  894. make dep
  895.  
  896.   IX.21)  How do I compile programs under Linux?
  897.  
  898. ANSWER: The Linux C library is trying to be ANSI/POSIX compliant. It
  899. is also very compatible with SYSV and BSD. The C library is loaded
  900. with SYSV and BSD functions. There are three exceptions:
  901.  
  902. 1. signal in Linux is POSIX.
  903. 2. tty in Linux is POSIX.
  904. 3. time functions are POSIX, plus a few BSD and SYSV extensions.
  905. 4. setjmp/longjmp functions are POSIX. But you can use -D__FAVOR_BSD
  906.    to make it BSD or use sigsigjmp/siglongjmp.
  907.  
  908. When you compile a program under Linux, your best bet is include all
  909. the appropriate header files and use -Wall. All the usable functions
  910. and global variables are declared in the corresponding header files.
  911. YOU SHOULD NOT DEFINE ANY functions or global variables OF THE LINUX C
  912. LIBRARY IN YOUR CODE IF YOU WANT TO USE THE SHARED LIBRARIES.
  913.  
  914. After saying all those, you now should know you can compile a program
  915. with -D_POSIX_SOURCE or -D_GNU_SOURCE (read <features.h> for details).
  916. With a few modifications you can even use -DSYSV, -DUSG or -DBSD. Some
  917. codes need to define -DSTDC_HEADERS for ANSI C compiler like gcc here.
  918.  
  919. To use malloc () and calloc () safely under Linux, please include
  920.  
  921. <stdlib.h> and don't define NO_FIX_MALLOC.
  922.  
  923. BTW, gcc -traditional should work with gcc 2.2.2d or above.
  924.  
  925. Please also read ChangeLog for the latest enhancement.
  926.  
  927. Please read the header files for details. Maybe you should get a book
  928. on POSIX. Any suggestion of the book list?
  929.  
  930. >From Steve Robbins  --  steve@nyongwa.cam.org
  931.  
  932. --------
  933. I like "POSIX Programmer's Guide", by Donald Lewine.  Its essentially
  934. a list of POSIX functions' man pages, with a very brief guide in the
  935. beginning of a few things.  It's published by O'Reilly & Associates,
  936. Inc.
  937. --------
  938.  
  939.   IX.22)  How can I get bsd style signal?
  940.  
  941. ANSWER: Use -D__USE_BSD_SIGNAL.
  942.  
  943.   IX.23)  Why does a program that should only poll for input become
  944. a CPU hog?
  945.  
  946. ANSWER: The select() system call. The timeout parameter was classically
  947. used read-only by the system. Some manual pages already notes three
  948. years ago:
  949.  
  950.        select() should probably return the  time  remaining  from
  951.        the  original timeout, if any, by modifying the time value
  952.        in place.  This may be implemented in future  versions  of
  953.        the system.  Thus, it is unwise to assume that the timeout
  954.        pointer will be unmodified by the select() call.
  955.  
  956. If you do not take this advice seriously you get a zero timeout written
  957. back to your timeout structure, which means that future calls to
  958. select() using the same timeout structure will immediately return.
  959.  
  960. Fix:
  961. Put the timeout value into that structure every time you call select().
  962. Change code like
  963.  
  964.        struct timeval timeout;
  965.        timeout.tv_sec = 1; timeout.tv_usec = 0;
  966.        while (some_condition)
  967.          { select(n,readfds,writefds,exceptfds,&timeout); }
  968.  
  969. to
  970.  
  971.        struct timeval timeout;
  972.        while (some_condition)
  973.          { timeout.tv_sec = 1; timeout.tv_usec = 0;
  974.            select(n,readfds,writefds,exceptfds,&timeout);
  975.          }
  976.  
  977.   IX.24)  When a program is stopped using Ctrl-Z and then restarted,
  978. or in other situations that generate signals: Ctrl-C interruption,
  979. termination of a child process etc. why does it complain about
  980. "interrupted system call" or "write: unknown error" or things like that.
  981.  
  982. ANSWER: The system call the program was executing has been interrupted
  983. to process the signal, and then it returned -1 and set errno = EINTR.
  984. The program then was likely to draw bad conclusions from that.
  985.  
  986. Explanation: Your program has signal handlers installed, using
  987. signal() or sigaction(). When the signal occurred, your signal handler
  988. was invoked. In other Unix systems, this usually happens asynchronously
  989. or in a few slow system calls:
  990.  
  991.   When a signal is caught during the execution of system calls such as
  992.   read(2), write(2), open(2) or ioctl(2) on a slow device (such as a
  993.   terminal, but not a file), during a pause(2) system call or a wait(2)
  994.   system call that does not return immediately because a previously
  995.   stopped or zombie process already exists, the signal-catching
  996.   function is executed and the interrupted system call then returns a
  997.   -1 to the calling process with errno set to EINTR.
  998.  
  999. Linux (following POSIX) checks for signals and may execute signal
  1000. handlers
  1001. * asynchronously (at a timer tick),
  1002. * on return from *any* system call,
  1003. * during the execution of the following system calls:
  1004.   select(),
  1005.   pause(),
  1006.   connect(), accept(),
  1007.   read() on terminals or sockets or pipes or /proc files,
  1008.   write() on terminals or sockets or pipes or line printer,
  1009.   open() on FIFOs or PTYs or serial lines,
  1010.   ioctl() on terminals,
  1011.   fcntl() with command F_SETLKW,
  1012.   wait4(),
  1013.   syslog(),
  1014.   any TCP or NFS operations.
  1015.   [For other operating systems you may have to include the system calls
  1016.    creat(), close(), getmsg(), putmsg(), msgrcv(), msgsnd(), recv(),
  1017.    send(), wait(), waitpid(), wait3(), tcdrain(), sigpause(), semop()
  1018.    to this list.]
  1019.  
  1020. In the last two cases and assuming the program's signal handler returns,
  1021. the system call returns -1 and sets errno to EINTR.
  1022.  
  1023. If the SA_INTERRUPT flag is not set for the corresponding signal,
  1024. however, in most cases the system call is automatically restarted
  1025. (continued) after execution of the signal handler, and your program
  1026. won't see any EINTR.
  1027.  
  1028. You may ask why this is not the default behavior when the default
  1029. Linux signal () is used to install the signal handler. This is because
  1030. POSIX adopted this. As for which one is better, it is a matter of
  1031. opinion.
  1032.  
  1033. Note that in some versions of BSD Unix the default behavior is to
  1034. restart system calls. To get system calls interrupted you have to use
  1035. the SA_INTERRUPT flag.
  1036.  
  1037. Fix:
  1038. Either add -D__USE_BSD_SIGNAL to your CFLAGS. Or for every signal
  1039. handler that you install with signal(), use sigaction() instead,
  1040. without setting SA_INTERRUPT.
  1041.  
  1042. Note that while this applies to most system calls, you must still check
  1043. for EINTR on read(), write(), ioctl(), select(), pause(), connect().
  1044. You may do it like this:
  1045.  
  1046.          int result;
  1047.          while (len > 0)
  1048.            { result = read(fd,buffer,len);
  1049.              if (result < 0) break;
  1050.              buffer += result; len -= result;
  1051.            }
  1052.    -->
  1053.          int result;
  1054.          while (len > 0)
  1055.            { result = read(fd,buffer,len);
  1056.              if (result < 0) { if (errno != EINTR) break; }
  1057.              else { buffer += result; len -= result; }
  1058.            }
  1059.  
  1060. and
  1061.  
  1062.          int result;
  1063.          result = ioctl(fd,cmd,addr);
  1064.    -->
  1065.          int result;
  1066.          do { result = ioctl(fd,cmd,addr); }
  1067.             while ((result == -1) && (errno == EINTR));
  1068.  
  1069.  
  1070.  
  1071.  
  1072. IX.B. OTHERS
  1073. ~~~~~~~~~~~~
  1074.  
  1075.   IX.25)  I seem to be unable to compile anything with gcc. Why?
  1076.  
  1077. ANSWER: If you have only 2 MB RAM, gcc will die silently without
  1078. compiling anything. You must have at least 4 MB to do compilations
  1079.  
  1080. BTW Since swapping is possible, I have heard that compilation works 
  1081. with only 2Meg and a lot disk traffic :) Isn't it great?
  1082.  
  1083.  
  1084.   IX.26)  gcc complains about not finding crt0.o and the system
  1085. include files What am I doing wrong ?
  1086.  
  1087. ANSWER: The include files normal place is in /usr/include. lib*.a and
  1088. *.o should be in /usr/lib or /usr/local/lib
  1089.  
  1090.  
  1091.   IX.27)  I tried to port a /new/ version of gnu stuff. But in the
  1092. linking phase, gcc complains about the missing libg.a. 
  1093.  
  1094.  
  1095. ANSWER: Yes this is well known for compiler version earlier than
  1096. 2.2.2, throw away the flag -g that's all, anyway libg.a is /only/ for
  1097. debugging purpose. 
  1098.  
  1099.  
  1100.   IX.28)  How to compile programs which may be debugged with gdb?
  1101.  
  1102. ANSWER: There are different ways to handle this problem. If
  1103. you have the gcc2.2.2 or later it's simple, use the -g flag. Otherwise
  1104. there are different possibilities:
  1105. 1) As there is no libg.a, you should throw away the -g flag in link
  1106. phase, this means that the compilation must be done in two steps
  1107. example: instead of "gcc -g monprog.c -o monprog", use the following
  1108. "gcc -g -c monprog.c" and then "gcc -o monprog monprog.o"
  1109. Alas this method is not that good if you are using Makefile.
  1110. 2) The other way is to create an empty libg.a as follows (Peter
  1111. MacDonald trick):
  1112. - create libfake.c containing libgfake() {}
  1113. - compile it with: gcc -c libfake.c
  1114. - create the libg.a with: ar r libg.a libfake.o
  1115. 2bis) The more tricky Humberto method:
  1116. cd /usr/lib
  1117. ranlib libg.a
  1118.  
  1119. then gcc -g monprog.c -o monprog will produce a debuggable monprog
  1120.  
  1121.  
  1122.   IX.29)  When compiling some code, cc1 complains about some insn
  1123. code, what's that? 
  1124.  
  1125. ANSWER: An insn is an internal representation that gcc uses when
  1126. compiling. The main part of gcc is to take ordinary c (or c++) code,
  1127. and compile it, while ding optimizations in insn part, which is
  1128. soft/hard independant. Then another part which is hard/Os dependant
  1129. takes the insns and translate it in assembly language. The fix is only
  1130. to turn off the optimization flag (-O). 
  1131.  
  1132.  
  1133.   IX.30)  When compiling #$@!, I've got some problems with "SIGBUS"
  1134. signal that doesn't exist. Any clue ?
  1135.  
  1136. ANSWER: (Louis J. LaBash, Jr.) SIGBUS is a common problem, its not
  1137. needed, just comment it all out, something like:
  1138.  
  1139. #ifdef SIGBUS
  1140. .. normal sigbus code ..
  1141. #endif
  1142.  
  1143.   IX.31)  How can I write codes suitable for building shared library ?
  1144.  
  1145. ANSWER: (Eric Youngdale, eric@tantalus.nrl.navy.mil, 3/1/93)
  1146.   
  1147. In general there are very few restrictions as long as you are using the
  1148. new tools for building sharable libraries.  Before the DLL libraries were
  1149. available there were all kinds of things you had to watch out for, but
  1150. currently you can more or less build a sharable library out of the box
  1151. without making any source code modifications.  See the README in the
  1152. tools-m-n.tar.z distribution for more information on how to build a
  1153. sharable library.  
  1154.  
  1155.  
  1156.  
  1157. X. SCSI SPECIAL
  1158. ===============
  1159. *** This section is written by Drew Eckhardt, mail him for
  1160. *** information, questions related to this section.
  1161. *** Last update May 1993.
  1162.  
  1163.    X.01)  What hardware is supported?
  1164.  
  1165. ANSWER: The Adaptec 154x, Adaptec 174x, Future Domain 8xx (TMC 
  1166. 950 based boards?), 16x0,  Seagate ST0x, Ultrastor 14F (Some of the 
  1167. new ALPHA code makes attempts to deal with the 34F) and Western Digital 
  1168. 7000 are supported.  Various Adaptec clones from Bustek and Future Domain 
  1169. are known to work, in both ISA and EISA flavors.
  1170.  
  1171. There is an alpha driver for the Ultrastor 24F -
  1172.  
  1173. tsx-11.mit.edu:/pub/alpha/scsi/u24f-driver.tar.z
  1174.  
  1175. Some of the SCSI drivers will not autodetect your SCSI host if the 
  1176. BIOS is disabled, and there may be IRQ, DRQ, address restrictions 
  1177. compiled into the distribution kernel.
  1178.  
  1179. Virtually all SCSI disks, CD ROMS, and tapes should work.
  1180.  
  1181.    X.02)  What hardware is not supported?
  1182.  
  1183. ANSWER: The Adaptec 152x, 151x, Always IN-2000, DTC, Mylex, PS/2 SCSI boards, 
  1184. all SCSI ports on sound boards, the trantor parallel->SCSI adapter, Rancho 
  1185. SCSI boards, Grass Roots SCSI boards, Trantor SCSI boards, etc.
  1186.  
  1187. Someone is working on a driver for the IN-2000, if you want to run Linux 
  1188. on one of the other boards, you'll have to get technical
  1189. docs on it, and write a driver yourself or bribe someone to do it.
  1190.  
  1191.    X.03)  How do I get SCSI information?
  1192.  
  1193. ANSWER: Subscribe to the SCSI channel of the linux-activists mailing list.
  1194. mail linux-activists@joker.cs.hut.fi 
  1195. And put in the header.
  1196.        X-MN-Admin: join SCSI
  1197.  
  1198.    X.04)  Where is the latest version maintained?
  1199.  
  1200. ANSWER: tsx-11.mit.edu:/pub/linux/ALPHA/scsi
  1201.  
  1202. Please join the SCSI channel of linux-activists@joker.cs.hut.fi before you 
  1203. grab anything.
  1204.  
  1205.    X.05)  I've found one of the following bugs :
  1206.  
  1207. - I can't swap to a SCSI disk, or mount one as /
  1208.  
  1209. - I get a READ CAPACITY FAILED message on bootup.
  1210.  
  1211. - I have a removeable disk (ie Sysquest) and have problems when I change
  1212.     media.
  1213.  
  1214. - I have a Seagate / Future Domain TMC-88x and the kernel panics with a 
  1215.     kernel paging message.
  1216.  
  1217. - I have an Adaptec 1742 and am experiencing data corruption
  1218.  
  1219. - I have an Insite floptical drive and it won't work.
  1220.  
  1221. - I have a TANDBERG TDC 3600 revision U07, SONYCD-ROM CDU-541 revision
  1222.     4.3d, DENON DRD-25X revision V, or a SEAGATE ST296 revision
  1223.     921 and the system hangs or reports multiple devices.
  1224.  
  1225. - My Adaptec 1542C isn't recognized.
  1226.  
  1227. ANSWER: All of these bugs have been fixed, so UPGRADE.  
  1228.  
  1229.    X.06)  What do I do if I find a bug that still looks like a 
  1230. bug after I've read the FAQ?
  1231.  
  1232. ANSWER: Your best bet is to send it to the SCSI channel of the mailing list,
  1233. where it will be seen by all of the people who've contributed to the 
  1234. SCSI drivers. 
  1235.  
  1236. In your bug report, please provide as much information as possible
  1237. regarding your hardware configuration, and all of the messages that 
  1238. Linux prints when it boots.  Your chances of getting the bug fixed increase 
  1239. exponentially with the amount of information provided.  
  1240.  
  1241. The bottom line is that if we can't reproduce your bug, and you can't 
  1242. point at us what's broken, it won't get fixed.
  1243.  
  1244.    X.07)  What SCSI disks are supported? 
  1245.  
  1246. ANSWER: Disks up to two terabytes in size will work, since the sd driver
  1247. switches to 10 byte reads when necessary.
  1248.  
  1249. Flopticals, Bernoulis, Sysquests, and other removeable media devices 
  1250. are supported by the normal SCSI disk driver.  
  1251.  
  1252.    X.08)  What about CD ROMS?
  1253.  
  1254. ANSWER: CD ROMS are supported. The ISO-9660 file system with Rockridge
  1255. extensions is supported.  You will have to make sure that you have 
  1256. configured the kernel to include the isofs filesystem or otherwise you 
  1257. will not be able to use the cdrom.
  1258.  
  1259.    X.09)  What about SCSI tapes ? 
  1260.  
  1261. ANSWER: Tapes are supported.  You may wish to obtain the utility program mt,
  1262. which is usually available from tsx-11.mit.edu in pub/linux/ALPHA/scsi.
  1263.  
  1264.    X.10)  How do I partition the disk?
  1265.  
  1266. ANSWER: Use fdisk, efdisk, pfdisk or the DOS parititioning program of 
  1267. your choice.
  1268.  
  1269.    X.11)  The linux partitioning programs don't work.
  1270.  
  1271. ANSWER: Some of these default to /dev/hd*, which are disks on 
  1272. WD-1003 compatable controllers (IDE, MFM, RLL, ESDI, etc), rather
  1273. than /dev/sd* (SCSI disks).   Your solutions are to 
  1274.  
  1275. 1.  Call the partitioning program with a device name, ie 
  1276.     pfdisk /dev/sda
  1277.  
  1278. 2.  Make links from /dev/hd* to /dev/sd*.  
  1279.  
  1280.    X.12)  My partitioning program can't figure out the disk geoemetry
  1281.  
  1282. The problem with partitioning SCSI disks and Linux is that Linux talks
  1283. directly to the SCSI interface.  Each disk is viewed as the SCSI host
  1284. sees it : N blocks, numbered from 0 to N-1, all error free.  There is
  1285. no portable way to get disk geometry.  
  1286.  
  1287. However, DOS doesn't like things like this, it demmands that BIOS
  1288. present it with a normal Cylinder / Head / Sector coordinates.  So,
  1289. BIOS does, and it comes up with some fabrication that fits what DOS
  1290. wants to see.  You don't want to disagree with what BIOS thinks when
  1291. you write the partition table. 
  1292.  
  1293. The newest SCSI code will return the mapped geometry for some host 
  1294. adapter / disk combinations.  Kernel release 0.99 and later should have
  1295. this capability.
  1296.  
  1297. QUESTION :  I can't make a filesystem on /dev/hd*
  1298.  
  1299. ANSWER : /dev/hd* aren't your SCSI disks.  /dev/sd* are. 
  1300. See below for approproate major / minor numbers if they 
  1301. do not exist on your root diskette.
  1302.  
  1303.    X.13)  What are the major / minor numbers for SCSI drives?
  1304.  
  1305. ANSWER: Because of the large number of devices that can be hung off of 
  1306. a SCSI bus (as many as 56 if you use SCSI fanouts or bridge boards), 
  1307. and the possibility of 16 partitions on a SCSI disk, we'd run out of 
  1308. minor numbers if they were statically allocated - so a dynamic 
  1309. numbering scheme is used.
  1310.  
  1311. Block device major 8 is used for SCSI drives, 11 for CD-ROMs.  
  1312. Character device major 9 is used for SCSI tapes.
  1313.         
  1314. Minors are assigned in increments of 16 to SCSI disks as they are
  1315. found, scaning from host 0, ID 0 to host n, ID 7, excluding the host
  1316. ID.  Most hosts use ID 7 for themselves.
  1317.  
  1318. A minor where minor mod 16 = 0 is the whole drive, where minor mod 16
  1319. is between 1 and 4, that partition, extended partitions dynamically
  1320. assigned from 5 to 15 inclusive.  Note that the gendisk.c module
  1321. prints partition tables on initialization - you should be able to see
  1322. them there.
  1323.  
  1324. Example : I have three SCSI disks, set up as follows 
  1325.         Seagate ST02, ID=0
  1326.         Seagate ST02, ID = 5
  1327.         Adaptec 1542, ID = 0
  1328.  
  1329. The first disk on the seagate at ID 0 will become minors 0-15
  1330. inclusive, the second at ID5 16-31 inclusive, the disk on the
  1331. Adaptec 48-63.
  1332.  
  1333.    X.14)  My tape drive or other removeable media device isn't recognized
  1334. at boot time.
  1335.  
  1336. ANSWER: Try booting with a tape in the drive.
  1337.  
  1338.    X.15)  How do I reduce kernel bloat and eliminate the drivers I
  1339. don't want?
  1340.  
  1341. ANSWER: For kernel release 0.99 and later, just go to the to directory
  1342. in the kernel source tree, and type ``make config'', and answer the
  1343. questions.  For older kernel distributions, simply #undef
  1344. CONFIG_DISTRIBUTION in include/linux/config.h, and define the macros
  1345. for the SCSI hosts you want enabled.
  1346.  
  1347.    X.16)  I get SCSI timeouts.
  1348.  
  1349. ANSWER: Make sure your board has interrupts enabled correctly, and 
  1350. that there are no conflicts with other devices (Sound boards 
  1351. and serial boards sometimes try to use IRQ5).
  1352.  
  1353.    X.17)  My Seagate / Future Domain TMC-88x board is not detected.
  1354.  
  1355. ANSWER: The Seagate and Future Domain boards have memory mapped 
  1356. registers.  To detect them, Linux scans for a signature in the 
  1357. ROM BIOS (typically, a copyright message) and sets the register
  1358. addresses relative to that.  
  1359.  
  1360. This can fail for two reasons
  1361. 1) If the BIOS is disabled.  
  1362.  
  1363. In this case, you should edit kernel/blk_drv/scsi/Makefile and 
  1364. add -DOVERIDE=x -DCONTROLLER=y where x is the base address of your 
  1365. controller (the factory default setting is 0xc8000) - note that 
  1366. this is *not* the segment (ie, 0xc800), and y is the controller 
  1367. type, either SEAGATE or FD.
  1368.  
  1369. 2) If we don't know about your BIOS yet
  1370.  
  1371.  
  1372. Please use DOS and DEBUG to find us a signature that will detect 
  1373. your board - 
  1374.  
  1375. Ie, if your board lives at 0xc800 do
  1376.  
  1377. debug
  1378. d c800:0
  1379. q
  1380.  
  1381. and send me (drew@cs.colorado.edu) the nearest convienient
  1382. ASCII message, with the length and offset from c800:0 or 
  1383. whereever.
  1384.  
  1385.    X.18)  The Seagate / Future Domain TMC-88x driver doesn't work.
  1386.  
  1387. ANSWER: There are several possibilities
  1388. 1) Is the board jumpered for IRQ5 ? 
  1389.  
  1390. The factory settings are for MSDOS, and have interrupts disabled.  
  1391.  
  1392. On the Seagate, Interrupts are controlled by the W3 (ST01) or JP3 (ST02) 
  1393. jumper.  Shorting pins F-G selects IRQ5.
  1394.  
  1395. 2) Cached machines will not have problems if the Seagate's address
  1396. space (typically C8000 - CAFFFF) is not marked "non cacheable."
  1397. This applies to the i486 internal cache as well as i386/i486 
  1398. external caches.
  1399.  
  1400. This can be set in the XCMOS of most machines.  If you can't disable
  1401. cache for the Seagate's area (16K in size, starting at the base
  1402. address), then you must disable the cache entirely, otherwise
  1403. it won't work.
  1404.  
  1405. 3) If you've defined -DFAST or -DFAST32 in the kernel, blind transfers 
  1406. will be used.  This works fine with most disks, but some won't respond 
  1407. fast enough, the read/write will timeout and things will get out 
  1408. of sync, resulting in timeouts.  Try recompiling your kernel without 
  1409. -DFAST or -DFAST32.
  1410.  
  1411.    X.19)  The Adaptec driver doesn't work.
  1412.  
  1413. ANSWER: A common source of difficulty is a conflict between two different
  1414. boards for an IRQ level, a DMA channel, or an I/O address.  Check the
  1415. settings for the boards you have in your system (music boards are
  1416. known to use similar IRQ or I/O addresses as the Adaptec.  In the new
  1417. scsi code the Adaptec can use any of the IRQ levels that it can be
  1418. strapped for, it can use I/O address 0x330 or 0x334, and it can use
  1419. DMA channels 5, 6 or 7.
  1420.  
  1421.    X.20)  The WD-7000FASST driver doesn't work
  1422.  
  1423. ANSWER: According to Keith Smith, 
  1424.  
  1425. "There are two different versions of the WD7000/FASST2  One uses a
  1426. WD33C93A the other a WD33C93.  Firmware incompatibilities in the board
  1427. bios could cause a problem as the former chip fixes some problems that
  1428. were discovered on the latter.  We're talking BOARD firmware, as well as
  1429. BIOS firmware."
  1430.  
  1431.    X.21)  My Ultrastor 14F or 34F isn't detected 
  1432.  
  1433. ANSWER: The Ultrastor 14F driver won't probe for an Adapter at address
  1434. 0x310.  Either move it do a different address, or recompile the kernel, 
  1435. adding a rule to kernel/blk_drv/scsi/Makefile
  1436.  
  1437. ultrastor.o: ultrastor.c
  1438.     $(CC) $(CFLAGS) -DOVERIDE_PORT=0x310 -c ultrastor.c
  1439.  
  1440.  
  1441.  
  1442.    X.22)  When using a Seagate / Future Domain TMC-88x, why does my system 
  1443. hang when syncing to disk?
  1444.  
  1445. ANSWER: The Seagate boards are an incredibly brain dead piece of hardware.
  1446. They can only generate an interrupt when a target raises the SEL signal.
  1447. So, as long as a target is connected, the Seagate driver must spin its 
  1448. wheels waiting for the actual data transfer.  Some devices agravate the 
  1449. situation by connecting for long periods of time while not doing anything.
  1450.  
  1451.    X.23)  My system is dog slow (ie, 60k/sec)
  1452.  
  1453. ANSWER: SCSI commands have an incredible amount of overhead.  For 
  1454. every command, you need to arbitrate for the bus, select the target,
  1455. establish an I_T_L nexus, and send the command.  Processing of that
  1456. command may take as much as 1ms on older devices.  Add this overhead
  1457. to what you already have coming through the file system, buffer 
  1458. cache, etc, and you have a real problem.
  1459.  
  1460. To work around this, we needed to maximize the amount of data that 
  1461. could be transfered in a single command.  So, we implemented 
  1462. scatter-gather, which allows reads/writes from/to contiguous 
  1463. disk sectors to non-contiguous buffers.  
  1464.  
  1465. This typically gets you a 3-5 fold improvement in performance.
  1466.  
  1467. The current kernel has scatter-gather support for the Adaptec, Western 
  1468. Digital, Ultrastor, Future Domain 16xx, Future Domain 8xx and Seagate 
  1469. boards.
  1470.  
  1471.  
  1472.        ===================8<==========>8================
  1473.  
  1474.  
  1475. -- 
  1476. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1477. #    LaBRI              |                        #
  1478. #  351 cours de la Liberation    |  e-mail:  corsini@geocub.greco-prog.fr   #
  1479. #  33405 Talence Cedex         |  e-mail:  corsini@labri.u-bordeaux.fr    #
  1480. #                   |                        #
  1481. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1482. -- 
  1483.      There will be a sig when our local net is reliable.
  1484.            For now, I would rather stay anonymous.
  1485.